package com.liu.webstore.service;

import com.liu.webstore.entity.LoginTicket;
import com.liu.webstore.entity.User;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;
import java.util.Map;

/**
 * @Author LiuYumei
 * @Date 2022/7/11 23:18
 */
public interface UserService {
    User getUserById(int id);

    Map<String, Object> register(User user);

    int activation(int userId, String code);

    Map<String, Object> login(String username, String password, int expireSeconds);

    void logout(String ticket);

    LoginTicket findLoginTicket(String ticket);

    int updateHeadPhoto(int userId, String headerUrl);

    int updatePassword(int id, String newPwd);

    User findByName(String toName);

    Collection<? extends GrantedAuthority> getAuthorities(int userId);
}
